{  Statement: http://acmp.ru/?main=task&id_task=514
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,n:longint;
    t:int64;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i := 1 to n do begin
    t := int64(i) * (int64(i) + 1) shr 1;
    if t >= n then begin
        if t > n then write(i - 1) else write(i);
        halt(0);
    end;
end;
end.